#ifndef Tj_drug_consume_dept_H
#define Tj_drug_consume_dept_H

#include <QWidget>
#include <QSqlQuery>
#include <QSqlQueryModel>

namespace Ui {
class Tj_drug_consume_dept;
}

class Tj_drug_consume_dept : public QWidget
{
    Q_OBJECT

public:
    explicit Tj_drug_consume_dept(QWidget *parent = nullptr);
    ~Tj_drug_consume_dept();

    void closeEvent(QCloseEvent *event);

signals:
    void destroyW( QString );

private slots:
    void on_pb_exit_clicked();

    void on_pb_fresh_clicked();

    void on_tv_drug_dept_doubleClicked(const QModelIndex &index);

    void on_tv_drug_dept_clicked(const QModelIndex &index);

    void on_pb_delete_clicked();

    void on_pb_save_clicked();

    void on_pb_fresh_sp_clicked();

    void on_tv_list_sp_doubleClicked(const QModelIndex &index);

    void on_tv_list_sp_clicked(const QModelIndex &index);

    void on_pb_delete_sp_clicked();

    void on_pb_add_sp_clicked();

    void on_tb_get_pic_file_clicked();

    void on_cbb_dept_sign_currentTextChanged(const QString &arg1);

    void on_pb_add_sign_clicked();

    void on_pb_fresh_sign_clicked();

    void on_tv_list_sign_doubleClicked(const QModelIndex &index);

    void on_tv_list_sign_clicked(const QModelIndex &index);

    void on_pb_delete_sign_clicked();

    void on_pb_fresh_pic_clicked();

    void on_tv_list_card_no_pic_doubleClicked(const QModelIndex &index);

    void on_tv_list_card_no_pic_clicked(const QModelIndex &index);

    void on_tb_get_pic_file_pic_clicked();

    void on_pb_upload_pic_clicked();

    void on_pb_med_rec_save_clicked();

    void on_cbb_doct_type_currentTextChanged(const QString &arg1);

    void on_lw_med_item_all_doubleClicked(const QModelIndex &index);

    void on_lw_med_item_doubleClicked(const QModelIndex &index);

    void on_tabWidget_currentChanged(int index);

private:
    Ui::Tj_drug_consume_dept *ui;

    QSqlQuery *qro, *qrot, *qrm;

    QSqlQueryModel *md, *md_sp, *md_sign, *md_pic;

    QString sq;

    QString store_depts, consume_depts, drug_type, dept_sign, doct_sign;

    QString pic_doct_code, pic_doct_name, pic_patient_code;
    QString pic_patient_name,pic_date,pic_dept,pic_clinic_code;

    bool initial_finished;

    QByteArray img_base64;

    QString remote_path,pic_path;
};

#endif // Tj_drug_consume_dept_H
